
mod share_counter;
mod person;
//跨模块共享变量
use share_counter as counter;
use person::person::Person;

use crate::person::person::Person2; 
fn main() {
    let i = 1;
    counter::set_counter(i);
    for _i in 1..10{
        std::thread::spawn(move||{
            counter::set_counter(i);
            println!("{} -",counter::get_counter());
        });
        
    }
    println!("{} ---",counter::get_counter());
    let do_something = Person::do_something(String::from("hi"));
    println!("{}",do_something);

}
